<?php
session_cache_expire(999999999);
if (!isset($_SESSION)) {
    session_start();
}

if (!isset($_SESSION['db'])) {
    $addressbrowser = $_SERVER['SERVER_NAME'];
    $temp = explode(".", $addressbrowser);
    $connection = mysql_connect("1.234.53.52", "cam", "5678");
    //$connection = mysql_connect("localhost", "root", "root" ) ;
    mysql_select_db("elihan", $connection);
    mysql_query("set names 'utf8'");
    $selectdatabase = mysql_query("SELECT am.DatabaseName,am.Logo from ac_eli_manager am where am.KeyName='$temp[0]' and am.`Status` = 2");
    $result = mysql_fetch_assoc($selectdatabase);

    $_SESSION['Logo'] = $result['Logo'];

    $_SESSION['db'] = $result['DatabaseName'];
    mysql_close($connection);
}
$database = $_SESSION['db'];
//$s = (string)(microtime(true)*1000);
//include("handle/get_number_list.php");
//$mysqli = new mysqli("1.234.53.52", "cam", "5678","$database");
//$mysqli = new mysqli("localhost", "root", "root","$database");
//$query = mysqli_query($mysqli,"call getTotalDocument($id_employee)");
/* while($row = mysqli_fetch_array($query)){
  $num_re_pending = $row['RePendingDoc'];
  $num_re_not_approve = $row['ReNotApprovedDoc'];
  $num_re_approved= $row['ReApprovedDoc'];

  $num_re_declined = $row['ReDeclinedDoc'];
  $num_re_reference_approved = $row['ReRefApprovedDoc'];
  $num_re_reference_waiting = $row['ReRefWaitingDoc'];
  $num_re_received_metting = $row['ReMeetingDoc'];


  $num_my_sendingDoc=$row['MySendingDoc'];
  $num_my_savedDoc=$row['MySavedDoc'];
  $num_my_approveDoc=$row['MyApproveDoc'];
  $num_my_declinedDoc=$row['MyDeclinedDoc'];
  $num_my_meetingDoc=$row['MyMeetingDoc'];

  $num_bin_re_doc = $row['BinReceiverDoc'];
  $num_bin_se_doc = $row['BinSendingDoc'];
  } */
//RePendingDoc
$sql = "SELECT count(IDTypeDoc) as RePendingDoc   FROM approvedoc a , listapprove b
		WHERE b.IDEmployee = $id_employee
		AND a.IDGroupApprove = b.IDGroupApprove
		AND a.IDTypeDoc  != 11
		AND a.IDStatus  = 2
		AND b.IDStatus  = 1";
//echo $sql."<br>";
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_re_pending = $r['RePendingDoc'];

//ReNotApprovedDoc
$sql = "SELECT count(IDTypeDoc) as ReNotApprovedDoc FROM approvedoc a , listapprove b 
		WHERE b.IDEmployee = $id_employee 
		AND a.IDGroupApprove = b.IDGroupApprove
		AND a.IDTypeDoc != 11
		AND a.IDStatus = 2
		AND b.IDStatus = 2";
//echo $sql."<br>";
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_re_not_approve = $r['ReNotApprovedDoc'];

//ReApprovedDoc
$sql = "SELECT count(IDTypeDoc) as ReApprovedDoc  FROM approvedoc a ,listapprove b 
		WHERE b.IDEmployee = $id_employee
		AND a.IDGroupApprove = b.IDGroupApprove
		AND a.IDTypeDoc != 11
		AND a.IDStatus = 1 
		AND b.IDLabel < 1
		AND b.IDStatus = 1";
//echo $sql."<br>";
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_re_approved = $r['ReApprovedDoc'];

//ReDeclinedDoc
$sql = "SELECT count(IDTypeDoc) as ReDeclinedDoc  FROM approvedoc a , listapprove b 
		WHERE b.IDEmployee = $id_employee
		AND a.IDGroupApprove = b.IDGroupApprove
		AND a.IDTypeDoc != 11
		AND a.IDStatus = 3 
		AND b.IDLabel < 1
		AND b.IDStatus = 3";
//echo $sql."<br>";
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_re_declined = $r['ReDeclinedDoc'];

//ReRefApprovedDoc
$sql = "SELECT count(IDTypeDoc) as ReRefApprovedDoc  FROM approvedoc p ,list_reference l 
		WHERE l.id_employee = $id_employee
		AND p.IDGroupApprove = l.id_group 
		AND p.IDTypeDoc != 11 
		AND l.IDLabel < 1
		AND l.id_status = 1 GROUP BY p.IDApproveDoc";
//echo $sql."<br>";
$mysql = mysql_query($sql);
//$r=mysql_fetch_array($mysql);
//$num_re_reference_approved = $r['ReRefApprovedDoc'];
$num_re_reference_approved = mysql_num_rows($mysql);
//ReRefWaitingDoc
$sql = "SELECT IDTypeDoc as ReRefWaitingDoc FROM approvedoc p, list_reference l  
		WHERE l.id_employee = $id_employee
		AND p.IDGroupApprove = l.id_group 
		AND p.IDTypeDoc != 11";
if (isset($_SESSION['db']) && $_SESSION['db'] == 'elitech')
    $sql.=" AND (l.id_status = 2 OR l.id_status = 4) GROUP BY p.IDApproveDoc";
else
    $sql.=" AND l.id_status = 2";
//echo $sql."<br>";    
$mysql = mysql_query($sql);
//$r=mysql_fetch_array($mysql);
$num_re_reference_waiting = mysql_num_rows($mysql);

//ReMeetingDoc
$sql = "SELECT count(IDTypeDoc) as ReMeetingDoc  FROM approvedoc a ,listapprove b 
		WHERE b.IDEmployee  = $id_employee
		AND a.IDGroupApprove = b.IDGroupApprove
		AND a.IDTypeDoc = 11
		AND a.IDStatus = 2
		AND b.IDStatus = 2";
//echo $sql;
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_re_received_metting = $r['ReMeetingDoc'];

//MySendingDoc
$sql = "SELECT count(IDTypeDoc) as MySendingDoc from approvedoc a
		WHERE a.IDStatus = 2
		AND a.IDEmployee = $id_employee
		AND a.IDTypeDoc != 11";
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_my_sendingDoc = $r['MySendingDoc'];
//echo $sql."<br>"; 
//MySavedDoc
$sql = "SELECT count(IDTypeDoc) as MySavedDoc from approvedoc a
		WHERE a.IDStatus = 4
		AND a.IDEmployee = $id_employee";
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_my_savedDoc = $r['MySavedDoc'];
//echo $sql."<br>"; 
//MyApproveDoc
$sql = "SELECT count(IDTypeDoc) as MyApproveDoc from approvedoc a
		WHERE a.IDStatus = 1 
		AND a.IDLabel < 1
		AND a.IDEmployee = $id_employee";
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_my_approveDoc = $r['MyApproveDoc'];
//echo $sql."<br>"; 
//MyDeclinedDoc
$sql = "SELECT count(IDTypeDoc) as MyDeclinedDoc from approvedoc a
		WHERE a.IDStatus = 3 
		AND a.IDLabel < 1
		AND a.IDEmployee = $id_employee";
//echo $sql;
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_my_declinedDoc = $r['MyDeclinedDoc'];

//MyMeetingDoc
$sql = "SELECT count(IDTypeDoc) as MyMeetingDoc from approvedoc a
		WHERE a.IDStatus = 2
		AND a.IDTypeDoc = 11
		AND a.IDEmployee = $id_employee";
//echo $sql;
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_my_meetingDoc = $r['MyMeetingDoc'];

//BinReceiverDoc
$sql = "SELECT count(IDTypeDoc) as BinReceiverDoc  FROM approvedoc a ,listapprove b  
		WHERE b.IDEmployee = $id_employee
		AND a.IDGroupApprove = b.IDGroupApprove
		AND a.IDTypeDoc != 11
		AND a.IDStatus = 6
		AND b.IDStatus = 1";
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_bin_re_doc = $r['BinReceiverDoc'];
//echo $sql."<br>"; 
//BinSendingDoc
$sql = "SELECT count(IDTypeDoc) as BinSendingDoc from approvedoc a
		WHERE a.IDStatus = 6
		AND a.IDEmployee = $id_employee";
$mysql = mysql_query($sql);
$r = mysql_fetch_array($mysql);
$num_bin_se_doc = $r['BinSendingDoc'];
//echo $sql."<br>"; 


$query1 = mysql_query("SELECT p.IDProject, p.NameProject, p.Description, p.DateStart, p.DateComplete, p.IDManager, p.Status
 FROM pr_project p,pr_composition c, employee e  WHERE ((c.IDEmployee = '$id_employee'  AND e.IDEmployee = c.IDEmployee) or (p.IDManager='$id_employee' and e.IDEmployee=p.IDManager)) AND p.IDProject = c.IDProject GROUP BY p.IDProject ORDER BY p.NameProject ASC");

/* mysql_query("UPDATE listapprove SET IDLabel = IDStatus WHERE IDStatus > 10");
  mysql_query("UPDATE listapprove SET IDStatus=1 WHERE IDStatus > 10"); */

$sql = "SELECT l.IDLable,l.LableName,
(SELECT COUNT(*) FROM approvedoc a WHERE a.IDLabel=l.IDLable) as slApprove,
(SELECT COUNT(*) FROM listapprove la,approvedoc a WHERE la.IDLabel=l.IDLable AND a.IDGroupApprove=la.IDGroupApprove AND la.IDEmployee='$id_employee') as slgApprove,
(SELECT COUNT(*) FROM list_reference lr,approvedoc a WHERE lr.IDLabel=l.IDLable AND a.IDGroupApprove=lr.id_group AND lr.id_employee='$id_employee') as slreference
FROM list_lable l WHERE l.IDEmployee='$id_employee';";
$manglibrary = mysql_query($sql);

/*$sql = "SELECT b.isView
		 	FROM approvedoc a ,listapprove b , employee e
			WHERE b.IDEmployee = '$id_employee' AND a.IDTypeDoc != 11 AND a.IDStatus= 2 AND b.IDStatus= 2 AND a.IDGroupApprove = b.IDGroupApprove AND a.IDEmployee = e.IDEmployee  AND b.isView=0"; //AND b.DateApprove >(CURDATE() - INTERVAL 30 DAY)";
$notappmysql = mysql_query($sql);*/
/*$sql = "SELECT a.isView
			FROM approvedoc a,employee e 
			WHERE a.IDEmployee=e.IDEmployee  and a.IDLabel<1 AND a.IDEmployee='$id_employee' AND a.IDStatus=1 AND a.isView=0 "; //AND a.TimeApprove >(CURDATE() - INTERVAL 30 DAY)";
$myappmysql = mysql_query($sql);*/
/*$sql = "SELECT a.isView
			FROM approvedoc a,employee e 
			WHERE a.IDEmployee=e.IDEmployee AND a.IDEmployee='$id_employee' AND a.IDStatus=3 and  a.IDLabel < 1 AND a.isView=0"; // AND a.TimeApprove >(CURDATE() - INTERVAL 30 DAY)";
$mydecmysql = mysql_query($sql);

$sql = "SELECT b.isView FROM approvedoc a ,list_reference b , employee e 
WHERE b.id_employee = '$id_employee' AND a.IDTypeDoc != 11 
AND b.id_status= 2 AND a.IDGroupApprove = b.id_group AND a.IDEmployee = e.IDEmployee AND b.isView=0"; // AND a.TimeApprove >(CURDATE() - INTERVAL 30 DAY)";
$notrefmysql = mysql_query($sql);*/

//$s1 = (string)(microtime(true)*1000);
//$s2=$s1-$s;
//echo $s1.'-'.$s.'='.$s2;

$mkq=mysql_query("SELECT typedoc.IDTypeDoc,tdn.".$_SESSION['lang']." as tdname,tpn.".$_SESSION['lang']." as tpname from typedoc,staticlang tdn, staticlang tpn,template 
	where typedoc.IDTypeDoc>6 and typedoc.IDTypeDoc!=11 
	and typedoc.IDConfigStaticLang = tdn.IDConfigStaticLang
	and typedoc.IDTemplate = template.IDTemplate 
	and template.IDConfigStaticLang = tpn.IDConfigStaticLang ORDER BY typedoc.IDTypeDoc asc");
$mangdoc=array();
while ($row=mysql_fetch_array($mkq)){
	$mangdoc[]=array($row[IDTypeDoc],$row[tdname]);
}

if (!$_SESSION['menuid']) {
    $_SESSION['menuid'] = array();
}


$menu_arrays = $_SESSION['menuid'];
$menu_pri = array_search("pri", $menu_arrays, true);
$menu_acc = array_search("acc", $menu_arrays, true);
$menu_app = array_search("app", $menu_arrays, true);
$menu_pri1 = array_search("pri1", $menu_arrays, true);
$menu_pri2 = array_search("pri2", $menu_arrays, true);
$menu_pro = array_search("pro", $menu_arrays, true);
$menu_em = array_search("em", $menu_arrays, true);
?>


<link rel="stylesheet" media="all" type="text/css" href="css/dropdown.css" />
<script
src="js/jquery.treeview.js" type="text/javascript"></script>
<script type="text/javascript">
    function menuEffect(ele){
        if($(ele).find('div:last').hasClass('collapsable-hitarea')){
            ajaxMenu('hide', $(ele).find('div:last').attr('id'));
            $(ele).find('div:last').removeClass('collapsable-hitarea');
            $(ele).find('div:last').addClass('expandable-hitarea');					
            $(ele).parent().find('ul:first').toggle();
        }else{
            ajaxMenu('show', $(ele).find('div:last').attr('id'));
            $(ele).find('div:last').removeClass('expandable-hitarea');
            $(ele).find('div:last').addClass('collapsable-hitarea');
            $(ele).parent().find('ul:first').toggle();
        }
    }
    function ajaxMenu(action,menuid){
        $.ajax({url:"ajax/ajaxmenu.php", data : {actions : action , menuid : menuid}});
    }
		
</script>
<script type="text/javascript">
    function addLable1(flagaction,content,idem)
    {
        var newname=encodeURIComponent(document.getElementById("vlNameLabel1").value);
        if (newname=="") { alert("Null rồi"); return;}
        if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp=new XMLHttpRequest();
        }else{// code for IE6, IE5
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function(){
            if (xmlhttp.readyState==4 && xmlhttp.status==200){
                document.getElementById("idlistLi").innerHTML=xmlhttp.responseText;
                /*$.ajax({url:"/ERP/ERP-PC/ajax/list/move_menu_left_library.php?lang="+lang+"&idem="+idem,success:function(result){
                                                                                                        //alert(result);
                                                                                                        $("#idlistLi").html(result);
                                                                                            }});*/
                //popuploadbel();
            }
        }
        xmlhttp.open("GET","ajax/process_all_li.php?idem="+idem+"&content="+content+"&flagaction="+flagaction+"&lablename="+newname,true);
        xmlhttp.send();
    }

    function deleteLable(flagaction,idem,content)
    {
        var name=document.getElementById("vlNameLabel2").value;
        var id=document.getElementById("vlIDLabel2").value;
        var soluong=document.getElementById("vlSoluong2").value;
        if (soluong>0) { alert("Lable đang chứa dữ liệu"); return;}
        if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp=new XMLHttpRequest();
        }else{// code for IE6, IE5
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function(){
            if (xmlhttp.readyState==4 && xmlhttp.status==200){
                document.getElementById("idlistLi").innerHTML=xmlhttp.responseText;
                /*$.ajax({url:"ajax/list/move_menu_left_library.php?lang="+lang+"&idem="+idem,success:function(result){
                                                                                                        //alert(result);
                                                                                                        $("#idlistLi").html(result);
                                                                                            }});*/
                //popuploadbel();
            }

        }
        hoi= confirm("<?php echo $l_areyousure; ?>");
        if (hoi==true) {
            xmlhttp.open("GET","ajax/process_all_li.php?idem="+idem+"&content="+content+"&flagaction="+flagaction+"&lableid="+id+"&lablename="+name,true);
            xmlhttp.send();
        }
    }

    function editLable(flagaction,idem,content)
    {
        var name=document.getElementById("vlNameLabel2").value;
        var id=document.getElementById("vlIDLabel2").value;
        if (name=="") { alert("Null rồi"); return;}
        if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp=new XMLHttpRequest();
        }else{// code for IE6, IE5
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function(){
            if (xmlhttp.readyState==4 && xmlhttp.status==200){
                document.getElementById("idlistLi").innerHTML=xmlhttp.responseText;
                /*$.ajax({url:"ajax/list/move_menu_left_library.php?lang="+lang+"&idem="+idem,success:function(result){
                                                                                                        //alert(result);
                                                                                                        $("#idlistLi").html(result);
                                                                                            }});*/
                //popuploadbel();
            }
        }
        xmlhttp.open("GET","ajax/process_all_li.php?idem="+idem+"&content="+content+"&flagaction="+flagaction+"&lableid="+id+"&lablename="+name,true);
        xmlhttp.send();
	
    }



    function getresult(namelabel,idlabel,soluong,ele){
        popuploadbel(ele);
        //alert(namelabel+" - "+idlabel+" - "+soluong);
	
        //var left = (screen.width/2)-(350/2);
        //var top = (screen.height/2)-(350/2);
        //return window.open(#popup_name2, 'trời ơi', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
        document.getElementById("vlNameLabel2").value=namelabel;
        document.getElementById("vlIDLabel2").value=idlabel;
        document.getElementById("vlSoluong2").value=soluong;
		
    }

    function xoainput(ele){
        popuploadbel(ele);
        document.getElementById("vlNameLabel1").value="";
	
    }
    function showMenu(status){
    	if(status==1){
        	if(document.getElementById('menucontents1').getAttribute('style')=='display:none;')
				document.getElementById('menucontents1').setAttribute('style','display:block;');
			else
				document.getElementById('menucontents1').setAttribute('style','display:none;');
    	}else{
    		if(document.getElementById('menucontents2').getAttribute('style')=='display:none;')
				document.getElementById('menucontents2').setAttribute('style','display:block;');
			else
				document.getElementById('menucontents2').setAttribute('style','display:none;');
    	}
    }
</script>
<link rel="stylesheet" type="text/css" href="css/menu.css" />
<style>
    * {
        font-family: verdana;
    }

    #fade { /*--Transparent background layer--*/
        display: none; /*--hidden by default--*/
        /*background: #000;*/
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        opacity: .80;
        z-index: 9999;
    }

    .popup_block {
        display: none; /*--hidden by default--*/
        background: #fff;
        border: 1px solid silver;
        float: left;
        font-size: 1.2em;
        position: fixed;
        top: 50%;
        left: 50%;
        z-index: 99999;
        /*--CSS3 Box Shadows--*/
        /*--CSS3 Rounded Corners--*/
    }

    .btn_close {
        float: right;
        margin: 5px 5px 0 0;
        color: white;
        font-weight: bold;
    }
    /*--Making IE6 Understand Fixed Positioning--*/
    * html #fade {
        position: absolute;
    }

    * html .popup_block {
        position: absolute;
    }

    .btnupbg {
        background: #309dcf;
        border-radius: 3px;
        color: white;
        cursor: pointer;
        font-weight: bold;
        height: 25px;
        padding: 0 5px 0;
        border-color: #C4C0B9;
        border-width: 1px;
        margin-right: 5px
    }

    .btnupbg:hover {
        background: #686868
    }

    .btnupload {
        background: -moz-linear-gradient(center top, #63B6DB, #309DCF) repeat;
    }
</style>
<div class="menu" style="min-width: 1555px;">

<ul>
<li><a class="hide" href="home.php" ><img src="images/icon_23_03.png"  style="padding-top: 4px"/><p style="margin-top: -23px;padding-left: 25px;"><?=$l_home?></p></a></li>

<li><a class="hide"  href="companyprofile.php" ><img src="images/index_39.png"  style="padding-top: 4px"/><p style="margin-top: -23px;padding-left: 25px;"><?= $l_menu_companyprofile ?></p></a></li>

<li><a class="hide" href="#"><img src="images/index_39.png"  style="padding-top: 4px"/><p style="margin-top: -23px;padding-left: 25px;"><?= $l_menu_privateinfo ?></p></a>

	<ul>
	<li><a href="yourProfile.php" title=""><?= $l_viewprofile ?></a></li>
	<li><a href="logHistory.php" title=""><?= $l_loginhistory ?></a></li>
	<?php if ($_SESSION['db'] == 'elitech') { ?>
	<li><a href="us_sa.php?content=us_sa_spreadworking_content" title=""><?= $l_working_spreadsheet ?></a></li>
	 <li><a   href="salary.php?content=employee_salary"><?= $l_employee_salaries ?> </a></li>
	<?php }?>
	</ul>


</li>
<?php
if (isset($_SESSION['ketoan'])) {
    if ($_SESSION['ketoan'] == 1) {
        ?>
<li><a class="hide" href="#"><img src="images/index_06.png"  style="padding-top: 4px"/><p style="margin-top: -23px;padding-left: 25px;"><?php echo $l_accountant; ?></p></a>

	<ul>
		<li><a class="hide">&gt;&gt; <?php echo $l_Invoice_thu; ?></a>
            <ul class="level2">
                <li><a  href="accountant-search.php?content=ac_elisoft_order_tax_content&status=0" title=""><?= $l_invoice_tax ?></a></li>
                <li><a href="accountant-search.php?content=ac_elisoft_search_order_tax_content&status=0" title=""><?= $l_search_invoice_tax ?></a></li>
            </ul>
        </li>
        <li><a class="hide">&gt;&gt; <?php echo $l_Invoice_chi; ?></a>
            <ul class="level2">
                <li><a href="accountant-search.php?content=ac_elisoft_order_tax_content&status=1" title=""><?= $l_invoice_tax ?></a></li>
                <li><a href="accountant-search.php?content=ac_elisoft_search_order_tax_content&status=1" title=""><?= $l_SearchPurchase ?></a></li>
            </ul>
        </li>
        
        <li><a href="payment.php?content=ac_elisoft_order_tax_content"><?php echo $l_payment; ?></a>
             <!--<ul class="level2">
                <li><a href="payment.php?content=ac_elisoft_order_tax_content" title=""><?= $l_in_payment?></a></li>
                <li><a href="accountant-search.php?content=ac_elisoft_search_order_tax_content&status=1" title=""><?= $l_SearchPurchase ?></a></li>
            </ul>-->
        </li>
        <li><a class="hide">&gt;&gt; <?php echo $l_contract; ?></a>
            <ul class="level2">
                <li><a href="contract.php?content=content_addcontract" title=""><?= $l_addcontract ?></a></li>
                <li><a href="contract.php?content=content_listcontract" title=""><?= $l_listcontract ?></a></li>
                <li><a href="contract.php?content=content_listcontractwarranty" title=""><?= $l_listcontractwarranty ?></a></li>
            </ul>
        </li>
        <li><a href="pay.php"><?php echo $l_pay_calendar; ?></a></li>
        <li><a href="search_approve.php" ><?php echo $l_search_approve; ?></a></li>
	</ul>


</li>

<?php }}?>
<?php
if (isset($_SESSION['ketoan'])) {
    if ($_SESSION['ketoan'] == 1) {
    	if ($_SESSION['db'] == 'elitech') {
        ?>
<li><a class="hide" href="#"><img src="images/index_39.png"  style="padding-top: 4px"/><p style="margin-top: -23px;padding-left: 25px;"><?php echo $l_ml_tinh_luong; ?></p></a>

	<ul>
		<li><a href="content_salary/salary_menu.php?content=import_checktime"><?= $l_ml_import_datatime ?></a></li>
        <li><a href="content_salary/salary_menu.php?content=working_spreadsheet"><?= $l_working_spreadsheet ?></a></li>
        <li><a href="salary.php?content=employee_salaries"><?= $l_employee_salaries ?></a></li>
        <li><a href="salary.php?content=sa_search_salary"><?= $l_search_salary ?></a></li>
        <li><a class="hide">&gt;&gt; <?php echo $l_setup_regulation; ?></a>
            <ul class="level2">
                <li><a href="salary.php?content=genera_allowance" title=""><?= $l_general_allowance ?></a></li>
                <li><a href="salary.php?content=allowance_hard_holiday" title=""><?= $l_allowance_hard_holiday ?></a></li>
                <li><a href="salary.php?content=regulation_salary" title=""><?= $l_regulation_salary ?></a></li>
            </ul>
        </li>
	</ul>


</li>

<?php }}}?>
<li><a class="hide" href="manage_assets.php"><img src="images/index_08.png"  style="padding-top: 4px"/><p style="margin-top: -23px;padding-left: 25px;"><?php echo $l_manage_assets; ?></p></a></li>

<li><a class="hide" href="#"><img src="images/index_11.png"  style="padding-top: 4px"/><p style="margin-top: -23px;padding-left: 25px;"><?php echo $l_e_approval; ?></p></a>

	
	<ul>
        <li><a href="ApproveMain" title=""><?php echo $l_main; ?></a></li>
        <li><a href="accountant-setup.php?content=accountant-setup-customer-content" title=""><?= $l_menuSetUpCustomer ?></a></li>
        <li><a href="newform" title=""><?php echo $l_newfom; ?></a></li>
      
        <li><a class="hide" href="#" title="">&gt;&gt;<?php echo $l_received_document; ?></a>
            <ul class="level2">
                <li><a href="received-list-receiver-pending-content" title=""><?= $l_pending_document ?>
										(<label id="num_re_pending"><?= $num_re_pending ?> </label>)</a></li>
                <li><a href="received-list-receiver-not-approved-content" title=""><?= $l_not_approved_document ?>
										(<label id="num_re_not_approve"> <!--<?php if (mysql_num_rows($notappmysql) == 0) { ?>
                                            <?= $num_re_not_approve ?> <?php } else { ?> <b><?= $num_re_not_approve ?>
                                                </b> <?php } ?> -->
                                           <?= $num_re_not_approve ?>     
                                          </label>)</a></li>
                <li><a href="received-list-receiver-approved-content" title=""><?= $l_approved_document ?>
										(<label id="num_re_approved"><?= $num_re_approved ?> </label>)</a></li>
                <li><a href="received-list-receiver-declined-content" title=""><?= $l_declined_document ?>
										(<label id="num_re_declined"><?= $num_re_declined ?> </label>)</a></li>
                <li><a href="received-list-receiver-reference-approved-content&TypeDoc=0" title=""><?= $l_reference_document_approved ?>(<label id="num_re_reference_approved"><?= $num_re_reference_approved ?></label>)</a></li>
                <li><a href="received-list-receiver-reference-waiting-content&TypeDoc=0" title=""><?= $l_reference_document_waiting ?>(<label id="num_re_reference_waiting"><?php if (mysql_num_rows($notrefmysql) == 0) { ?>
                                            <?= $num_re_reference_waiting ?> <?php } else { ?> <b><?= $num_re_reference_waiting ?>
                                                </b> <?php } ?>
                                        </label>)</a></li>
	            <li><a href="received-list-receiver-meeting-pending-content" title=""><?= $l_meeting_document ?>
										(<label id="num_re_received_metting"><?= $num_re_received_metting ?>
                                        </label>)</a></li>
            </ul>
        </li>
        <li><a class="hide" href="#" title="">&gt;&gt;<?php echo $l_my_document; ?></a>
            <ul>
                <li><a href="mydocument-list-mydocument-sending-content" title=""><?= $l_my_sendingDoc ?>
										(<label id="num_my_sendingDoc"><?= $num_my_sendingDoc ?> </label>)</a></li>
                <li><a href="mydocument-list-mydocument-saved-content"><?= $l_my_savedDoc ?>
										(<label id="num_my_savedDoc"><?= $num_my_savedDoc ?> </label>)</a></li>
                <li><a href="mydocument-list-mydocument-approved-content"><?= $l_my_approveDoc ?>
										(<label id="num_my_approveDoc"> <!--<?php if (mysql_num_rows($myappmysql) == 0) { ?>
                                            <?= $num_my_approveDoc ?> <?php } else { ?> <b><?= $num_my_approveDoc ?>
                                                </b> <?php } ?> -->
                                                <?=$num_my_approveDoc?>
                                             </label>)</a></li>
                <li><a href="mydocument-list-mydocument-declined-content"><?= $l_my_declinedDoc ?>
										(<label id="num_my_declinedDoc"> <!--<?php if (mysql_num_rows($mydecmysql) == 0) { ?>
    <?= $num_my_declinedDoc ?> <?php } else { ?> <b><?= $num_my_declinedDoc ?>
                                                </b> <?php } ?>-->
                                                <?= $num_my_declinedDoc ?>
                                                 </label>)</a></li>
                <li><a href="mydocument-list-mydocument-meeting-sending-content"><?= $l_my_meetingDoc ?>
										(<label id="num_my_meetingDoc"><?= $num_my_meetingDoc ?> </label>)</a></li>
            </ul>
        </li>
         <li><a class="hide" href="#" title="">&gt;&gt;<?php echo $l_re_bin; ?></a>
            <ul>
                <li><a href="mybin-list-mybin-recedoc-content"
                                        onclick="onclickajax()"><?= $l_re_document ?> (<label
                                            id="num_bin_re_doc"><?= $num_bin_re_doc ?> </label>)</a></li>
                <li><a href="mybin-list-mybin-senddoc-content"><?= $l_se_document ?>
										(<label id="num_bin_send_doc"><?= $num_bin_se_doc ?> </label>)</a></li>
            </ul>
        </li>
         <li><a class="hide" href="#" title="">&gt;&gt;<?php echo $l_li_document; ?></a>
            <ul>
                <li><a href="#?w=350" onclick="xoainput(this);" rel="popup_name1"
                                        class="poplight"><?= $l_new_label ?></a></li>
                <?php
                            if (count($manglibrary) > 0) {
                                $vitri = 1;
                                while ($row = mysql_fetch_array($manglibrary)) {
                                    ?>
                <li><a href="library.php?content=list-library-content&liname=<?php echo $row[LableName]; ?>&libraryid=<?php echo $row[IDLable]; ?>" title=""><?php echo $row[LableName] ?>
        <?php
        $soluong = $row[slApprove] + $row[slgApprove] + $row[slreference];
        echo " ( " . $soluong . " )";
        ?> </a></li>
        <?php
    }
}
?>
            </ul>
        </li>
    
        
	</ul>



</li>

<li><a class="hide" href="#"><img src="images/index_39.png"  style="padding-top: 4px"/><p style="margin-top: -23px;padding-left: 25px;"><?php echo $l_menu_private; ?></p></a>


	<ul>
	<li><a href="privatememo.php"title=""><?php echo $l_menu_privatememo; ?></a></li>
	<li><a href="calendar.php" title=""><?=$l_work_calendar?></a></li>
	</ul>


</li>

<li><a class="hide" href="#" ><img src="images/index_25.gif"  style="padding-top: 6px"/><p style="margin-top: -20px;padding-left: 25px;"><?php echo $l_projectlist; ?></p></a>

	<ul>
	<?php
while ($row = mysql_fetch_array($query1)) {
    $idproject = $row[IDProject];
    $nameproject = $row[NameProject];
    ?>
        <li><a href="project.php?projectDetail=project-detail&id=<?=$idproject?>&status=0" ><?= $nameproject ?></a></li>
    <?php } ?>
	</ul>


</li>
<?php
if ($_SESSION['db'] == 'elitech') {
    ?>
<li><a class="hide" href="employee-working.php" ><img src="images/index_39.png"  style="padding-top: 4px"/><p style="margin-top: -23px;padding-left: 25px;"><?php echo $l_employee; ?></p></a></li>
<?php }?>
</ul>
<form action="operations/set_lang.php" method="post">

<img alt="" style="width: 27px;float: right;padding-right: 10px;" src="images/tag.png" onclick="window.location.assign('operations/set_ngang.php');">

</div>
<form method="post" id="fleft" name="fleft" action="">
    <div id="popup_name1" class="popup_block">
        <span
            style="background: #424242; color: #FFFFFF; display: block; padding: 5px 0 5px 10px;"><?php echo $l_new_label; ?>
        </span>
        <table width="100%" style="margin: 20px 0">
            <tr>
                <td width="15%"><b><?php echo $l_name; ?> </b></td>
                <td valign="top"><input type="text" id="vlNameLabel1"
                                        name="vlNameLabel1"
                                        style="height: 23px; width: 95%; border: 1px solid #ccc" size="35"
                                        maxlength="50" value="" /></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <div align="center" style="padding-top: 3px;">
                        <input type="button" class="btnupbg btnupload iclose"
                               style=" font-size: 12px; width: 100px; float: right; margin-right: 13px;"
                               value="<?php echo $l_cancel; ?>" /> <input type="button"
                               onclick="addLable1('newlb','<?php echo $_SESSION['action']; ?>','<?php echo $id_employee; ?>');"
                               style="float: right;  font-size: 12px; width: 100px;"
                               class="btnupbg btnupload iclose" value="<?php echo $l_create; ?>" />

                    </div>
                </td>
            </tr>
        </table>
    </div>

    <div id="popup_name2" class="popup_block">

        <span
            style="background: #424242; color: #FFFFFF; display: block; padding: 5px 0 5px 10px;"><?php echo $l_new_label; ?>
        </span>
        <table width="100%" style="margin: 20px 0">
            <tr>
                <td width="15%"><b><?php echo $l_name; ?> </b></td>
                <td valign="top"><input type="hidden" name="vlIDLabel2"
                                        id="vlIDLabel2" /> <input type="hidden" name="vlSoluong2"
                                        id="vlSoluong2" /> <input type="text" id="vlNameLabel2"
                                        name="vlNameLabel2"
                                        style="height: 23px; width: 95%; border: 1px solid #ccc" size="35"
                                        maxlength="50" /></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <div align="center" style="padding-top: 3px;">
                        <input type="button" class="btnupbg btnupload iclose"
                               style=" font-size: 12px; width: 87px; float: right; margin-right: 13px;"
                               value="<?php echo $l_cancel; ?>" /> <input type="button"
                               onclick="deleteLable('deletelb','<?php echo $id_employee ?>','<?php echo $_SESSION['action']; ?>');"
                               style="float: center;  font-size: 12px; width: 87px;"
                               class="btnupbg btnupload iclose" value="<?php echo $l_delete; ?>" />
                        <input type="button"
                               onclick="editLable('editlb','<?php echo $id_employee ?>','<?php echo $_SESSION['action']; ?>');"
                               style="float: left;  font-size: 12px; width: 87px; margin-left: 0px;"
                               class="btnupbg btnupload iclose" value="<?php echo $l_edit; ?>" />
                    </div>
                </td>
            </tr>
        </table>
    </div>
</form>